package com.study.model.pojo;

import java.io.Serializable;
import javax.persistence.*;
import java.math.BigDecimal;
import java.util.Date;
import java.util.List;


/**
 * The persistent class for the offers database table.
 * 
 */
@Entity
@Table(name="offers")
@NamedQuery(name="Offer.findAll", query="SELECT o FROM Offer o")
public class Offer implements Serializable {
	private static final long serialVersionUID = 1L;

	@Id
	@Column(name="off_id")
	private int offId;

	@Column(name="off_name")
	private String offName;

	@Column(name="off_offer")
	private BigDecimal offOffer;

	@Column(name="off_profit")
	private BigDecimal offProfit;

	@Temporal(TemporalType.DATE)
	@Column(name="offe_quotationtime")
	private Date offeQuotationtime;

	@Column(name="opp_remark")
	private String oppRemark;
	
	@Column(name="lin_id")
	private Integer linId;
	
	@Column(name="is_show")
	private int isShow;
	
	@Column(name="opp_celv")
	private String oppCelv;
	
	
	@Column(name="is_order")
	private int isOrder;
	
	//bi-directional many-to-one association to Customer
	@ManyToOne
	@JoinColumn(name="cus_id")
	private Customer customer;

	//bi-directional many-to-one association to Opportunity
	@ManyToOne
	@JoinColumn(name="opp_id")
	private Opportunity opportunity;

	//bi-directional many-to-one association to User
	@ManyToOne
	@JoinColumn(name="user_id")
	private User user;

	//bi-directional many-to-one association to Offersdetail
	@OneToMany(mappedBy="offer")
	private List<Offersdetail> offersdetails;

	public Offer() {
	}

	public int getOffId() {
		return this.offId;
	}

	public void setOffId(int offId) {
		this.offId = offId;
	}

	public String getOffName() {
		return this.offName;
	}

	public void setOffName(String offName) {
		this.offName = offName;
	}

	public BigDecimal getOffOffer() {
		return this.offOffer;
	}

	public void setOffOffer(BigDecimal offOffer) {
		this.offOffer = offOffer;
	}

	public BigDecimal getOffProfit() {
		return this.offProfit;
	}

	public void setOffProfit(BigDecimal offProfit) {
		this.offProfit = offProfit;
	}

	public Date getOffeQuotationtime() {
		return this.offeQuotationtime;
	}

	public void setOffeQuotationtime(Date offeQuotationtime) {
		this.offeQuotationtime = offeQuotationtime;
	}

	public String getOppRemark() {
		return this.oppRemark;
	}

	public void setOppRemark(String oppRemark) {
		this.oppRemark = oppRemark;
	}

	
	public Customer getCustomer() {
		return this.customer;
	}

	public void setCustomer(Customer customer) {
		this.customer = customer;
	}

	public Opportunity getOpportunity() {
		return this.opportunity;
	}

	public void setOpportunity(Opportunity opportunity) {
		this.opportunity = opportunity;
	}

	public User getUser() {
		return this.user;
	}

	public void setUser(User user) {
		this.user = user;
	}

	public List<Offersdetail> getOffersdetails() {
		return this.offersdetails;
	}

	public void setOffersdetails(List<Offersdetail> offersdetails) {
		this.offersdetails = offersdetails;
	}

	public Offersdetail addOffersdetail(Offersdetail offersdetail) {
		getOffersdetails().add(offersdetail);
		offersdetail.setOffer(this);

		return offersdetail;
	}

	public Offersdetail removeOffersdetail(Offersdetail offersdetail) {
		getOffersdetails().remove(offersdetail);
		offersdetail.setOffer(null);

		return offersdetail;
	}

	public int getLinId() {
		return linId;
	}

	public void setLinId(int linId) {
		this.linId = linId;
	}

	public int getIsShow() {
		return isShow;
	}

	public void setIsShow(int isShow) {
		this.isShow = isShow;
	}

	public String getOppCelv() {
		return oppCelv;
	}

	public void setOppCelv(String oppCelv) {
		this.oppCelv = oppCelv;
	}

	public int getIsOrder() {
		return isOrder;
	}

	public void setIsOrder(int isOrder) {
		this.isOrder = isOrder;
	}

	public void setLinId(Integer linId) {
		this.linId = linId;
	}
	
}